package pl.edu.agh.bd2.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;

@Entity
@Inheritance(strategy=InheritanceType.JOINED)
@Table(name="_user")
public class User {
	
	@Id
	@GeneratedValue
	@NotNull
	private long id;
	
	@Column(name="login")
	@Length(max=30)
	private String login;
	
	@Length(max=30)
	@Column(name="password")
	private String password;
	
	@Column(name="role")
	@Length(max=20)
	private String role;
	
	@Length(max=40)
	@Column(name="contactemail")
	private String contactEMail;
	
	@Length(max=15)
	@Column(name="phonenumber")
	private String phoneNumber;
	
	public User(String login, String password, String role, String contactEMail,
			String phoneNumber) {
		super();
		this.login = login;
		this.password = password;
		this.role = role;
		this.contactEMail = contactEMail;
		this.phoneNumber = phoneNumber;
	}
	
	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public User(){
		
	}

	public String getLogin() {
		return login;
	}

	public void setLogin(String login) {
		this.login = login;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getRole() {
		return role;
	}

	public void setRole(String role) {
		this.role = role;
	}

	public String getContactEMail() {
		return contactEMail;
	}

	public void setContactEMail(String contactEMail) {
		this.contactEMail = contactEMail;
	}

	public String getPhoneNumber() {
		return phoneNumber;
	}

	public void setPhoneNumber(String phoneNumber) {
		this.phoneNumber = phoneNumber;
	}
	
	
}